package com.yzion.baselib.fragment

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.viewbinding.ViewBinding

/**
 * Fragment基类，使用ViewBinding
 */
abstract class BaseBindingFragment<VB : ViewBinding> : BaseFragment() {

    lateinit var binding: VB

    final override fun setContentView(
        inflater: LayoutInflater,
        savedInstanceState: Bundle?
    ): View {
        binding = getViewBinding(inflater, savedInstanceState)
        return binding.root
    }

    /**
     * 实例化对应的ViewBinding
     */
    abstract fun getViewBinding(
        inflater: LayoutInflater,
        savedInstanceState: Bundle?
    ): VB
}
